package com.ktwlsoft.archivemanage.domain.business.repositoryService.mend;

import com.ktwlsoft.archivemanage.domain.dao.entity.mend.MendSubjectOption;
import com.ktwlsoft.archivemanage.domain.dao.repository.mend.MendSubjectOptionMapper;
import com.ktwlsoft.archivemanage.payload.mendList.MendVerifySubjectOption;
import lombok.Getter;
import org.springframework.stereotype.Component;

@Component
public class MendSubjectOptionRepositoryService {

    @Getter
    private final MendSubjectOptionMapper mendSubjectOptionMapper;

    public MendSubjectOptionRepositoryService(MendSubjectOptionMapper mendSubjectOptionMapper) {
        this.mendSubjectOptionMapper = mendSubjectOptionMapper;
    }

    public int delete(Long subjectId) {
        return mendSubjectOptionMapper.deleteBySubjectId(subjectId);
    }

    public int save(MendSubjectOption option) {
        return mendSubjectOptionMapper.insert(option);
    }

    public int verify(MendVerifySubjectOption option) {
        return mendSubjectOptionMapper.verify(option);
    }

    public int verifyUncheckAll(Long mendSubjectId) {
        return mendSubjectOptionMapper.uncheckAll(mendSubjectId);
    }
}
